import { ImagesLibraryModule } from '@yk/components/draw/editor-draw/library/type'

const modulesFiles = import.meta.glob<ImagesLibraryModule>('./modules/*/index.ts', { eager: true })
const library = Object.keys(modulesFiles).reduce((library: Record<string, any>, modulePath) => {
  const moduleName = modulePath.replace(/^\.\/(.*)\/index\.ts$/, '$1')
  library[moduleName] = modulesFiles[modulePath].default
  return library
}, {})
export default library
